import React from 'react'

export default function Checkbox({checked, state = true, onChange}) {
  const handleChange = (e) => {
    if (state) {
      onChange(e.target.checked);
    }
  };
  return (
    <input type="checkbox" checked={checked} disabled={!state} onChange={handleChange} className="checkbox w-5 h-5 rounded-xs" />
  )
}
